package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.Getter;

@Getter
public enum TradingPoolTransactionTypeEnum {
    BUY(0, "购买"),
    SELL(1, "出售"),
    ;


    /**
     * 标识位
     */
    @EnumValue
    private Integer code;

    /**
     * 描述
     */
    private String description;

    TradingPoolTransactionTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    @JsonCreator
    public static TradingPoolTransactionTypeEnum fromString(String value) {
        if (value == null || value.isEmpty()) {
            return null;
        }
        return TradingPoolTransactionTypeEnum.valueOf(value.toUpperCase());
    }

}
